<template>
  <div class="shop-item">
    <span class="iconfont iconf" :class="data.icon" :style="{ color: data.color }"></span>
    <p>
      <span>{{ data.title }}</span>
      <span v-if="data.money" class="money">{{ money }}</span>
    </p>
    <i class="iconfont icon-jiantou"></i>
  </div>
</template>

<script>
export default {
  name: 'ShopItem',
  props: ['data'],
  computed: {
    money() {
      return (this.data.money = this.data.money ? '￥' + this.data.money : null)
    }
  }
}
</script>

<style lang="scss" scoped>
.shop-item {
  height: 0.49rem;
  background: #fff;
  margin-left: 0.15rem;
  padding-right: 0.15rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 0.5px solid #eee;
  .iconf {
    font-size: 0.26rem;
    margin-right: 0.15rem;
  }
  p {
    flex: 1;
    font-size: 0.15rem;
    display: flex;
    justify-content: space-between;
  }
  i {
    font-size: 0.12rem;
    color: #eee;
  }
}
.money {
  color: #797d82;
}
</style>